package cn.xsly.ymcc.fegin;


import cn.xsly.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeginFactory implements FallbackFactory<CourseFeginClient> {
    @Override
    public CourseFeginClient create(Throwable throwable) {
        throwable.printStackTrace();
        return new CourseFeginClient() {
            @Override
            public JSONResult courseStateById(Long id) {
                return JSONResult.error("课程服务异常");
            }

            @Override
            public JSONResult orderList(String ids) {
                return null;
            }
        };
    }
}